Steps in making computer programs {computer programming} {programming, computer} are defining problem, creating algorithm to solve problem, making flowchart to see how to implement algorithm conceptually, writing program using language and following flowchart, and checking program for errors.
Computers can process problem-solving algorithms {computer program}. Computer programs are explicit formal processes to generate output from input and internal settings. Programs have instruction sequences.
types
User programs perform arithmetic calculations, word processing, or spreadsheet manipulations. Utility programs perform functions about files and directories. Environmental programs work in background to perform accounting, memory-utilization, and scheduling functions.
making
Set goals or requirements. Develop functions to achieve goals. Design how to implement functions. Implement actual code.
module
Programs can have small independent programs {module, program}, to reach intermediate goals.
errors
Languages have special commands or techniques for error or exception handling, which replace IF ... THEN ... statements, prevent crashes, give needed information about errors or warnings, and provide logging information.
process
Code development follows standard process, uses standard methodology, and has life cycle. Requirements state involved units and required deliverables. Flow charts, such UML diagrams, show workflows, inputs, outputs, and use cases.
Programs have subunits {program structure}, such as declarations, executable units, loops, functions, subroutines, procedures, and recursive or reentrant subunits. Program have data types, such as arithmetic, Boolean, alphanumeric, formal or algebraic, string, list, vector, array, or hierarchical. Program statements assign variables or values, handle alphanumeric data, control sequences, make decisions, input, output, debug, store, and operate on system statements.
Programs can use addresses {descriptor, computing} to locate program segments or data blocks {addressing}. Descriptors contain addresses pointing to program-segment or data-block locations, word counts indicating program-segment or data-block sizes, and descriptor-sequence descriptor bits {presence-bit}.
Sets {collection} can have same-type objects {homogeneous collection} or different types {heterogeneous collection}.
Checking {debugging}| programs for errors follows programming.
Stored value arrays {decision table} {lookup memory} can allow result look-up for already-performed calculations, rather than performing calculations.
Processing operations {instruction, computing} need two steps. First, get instruction from storage and put it in instruction register. Then get data from address and put it in data register. Instructions can specify many addresses, including next instruction address. CPU has 30 basic instructions.
stack
Instead of using addresses, instructions {zero-address instruction} can specify stack, stack dictionary level, and dictionary-level index value {address couple}.
program
Instructions are elementary switches or gates {microfunction} and so are small programs {microprogram}.
Existing functions can be open for extension to new requirements but closed for modifications affecting published interfaces {open-closed principle}.
Operations {operations, program} on input values give output values. Operations include all arithmetical operations. Operations {let command} {set command} can calculate function value. Operations {if ... then ... commands} {conditional command} can check statement truth and perform actions. Operations {for ... next commands} {loop command} can repeat instruction sets over index-value ranges. Operations {goto command} {subroutine} can jump to another instruction block.
Statements can have operators and operands in correct sequence to execute them {Polish notation}, requiring no addressing, storage, or retrieval.
Program variables can be infinite value sets {set-based analysis} (SBA), so program ignores variable dependencies but considers all data and data structures.
Alphabetical operations {string operation} can extract sequence {string, text} parts {substring}. String operations can find string location {index, string} in another string. String operations can partition string to make array.
Logical-step series {workflow}| start from input and use processes and decisions to reach output, typically using branching paths.
High-level function-organization description {software architecture} {system architecture} defines system.
Components include applications, technical services, integration services, business services, and data services {computer system}.
Architectures {Common Object Request Broker Architecture} can have object-oriented ways to handle data between clients and servers, using Interface Definition Language (IDL) and Internet Inter-ORB Protocol (CORBA).
execution environment {envelope, computing}.
Models {implementation model} can describe function logical and physical representation.
Modules can have use in several programs {overlaying}.
User-interface sections {punch-out} can be for multiple applications.
Method invocations {Remote Method Invocations} (RMI) can use Java data model.
Related reusable class sets {toolkit} provide general functions.
Integrated project stages, methods, and principles {unified process} develop and maintain software.
Objects {value object} transfer data between presentation and domain layers.
Tools {software design tools} can check high-level design models {model checking}, using automated reasoning on structure language, to prove algorithms have no counterexamples or contradictions. Integrated-circuit design uses model checking. Systems have object operations, mappings, and relations, with assertions. Design-checkers try to find cases in which assertions are not true, so designers can exclude those cases.
Designs {contract-based design} can specify contracts between user and service provider. If user provides requisites {pre-conditions}, then service provider guarantees service will perform functions and give results {post-conditions}.
Starting with requirements, specifying functions and designing objects {responsibility-driven design} can meet requirements.
Designs {top-down design} can use modules, which contain submodules, which contain sub-submodules, and so on.
Abstract-class sets {framework} can work together in reusable designs.
Frameworks {request-response framework} can be integration services that send service requests to technical services, applications, and business-model instances and receive responses. Service-request {request, computer} execution environment can include required input. Service-response {response, computer} execution environment can include output.
Frameworks {services framework} can define and specify service uses.
System components {software layers} can be for applications, technical services, integration services, business services, and data services.
Software layers {application layer} can include installers and user interfaces and use business and technical services, through integration services. Interfaces are for navigating, querying, calculating, displaying, and reporting.
Software layers {business layer} can include instrument controls, analysis tools, quality-control modules, parameter settings, queries, and business objects. Models {business model} can be business-object content, behavior, rules, and interactions. Data objects {business object} are in systems. Service groups {business service} access and control shared domain-specific service interfaces, such as instrument controls and data.
Software layers {data layer} can include auditing, ID, password, authentication, persistence, and relational database. Implementation-model subset {data model} describes persistent procedure, trigger, and constraint logical and physical data representation.
Software layers {domain layer} can contain modules working with data objects. Business-model subsets {domain model} can have business types.
Software layers {integration layer} can include request-response, instrument, workflow, directory, and messaging services. A service group {integration service} includes request-response framework, architectural framework, and services that access and control shared services.
Software layers {presentation layer} can contain user interfaces.
Querying, versioning, or persisting data {system service} {software services} happens upon request for service or system function. Software components {service provider} provide service functions, such as for instrument runtime or messaging. System-architecture primary services allow other-service development.
Java class and component-library APIs {Java Database Connectivity} (JDBC) can allow Java applications to communicate with database server, outside database software.
Services {Java Message Service} (JMS) can publish and listen for messages.
Java extensions {Java Naming and Directory Interface} (JNDI) can provide API for accessing directory and naming services, such as LDAP, Novell Netware NDS, CORBA Naming Service, and naming services provided by EJB servers. EJB servers organize beans into directory structure and provide JNDI driver service provider for accessing directory structure.
JNDI database {naming service} contains named objects, with no attributes.
Infrastructure services {technical service} can be for applications and business services: logging, security, exceptions, and system management.
Computer instructions have exactly defined and limited vocabulary, syntax, and grammar {formal language, programming} {programming language}| {computer language}, with no ambiguities or connotations.
parts
Programming languages have alphabet {character set} that makes numbers and words in formats. They have mathematical functions, logical operations, and string manipulations {operator, programming}. They have processing instructions {executable}. They have sentences {declaration, programming} {non-executable declaration} that name, set up arrays, or create symbols.
levels
Machine uses machine-dependent binary code {machine language}. Assembler uses machine-dependent three-letter codes {assembly language} for instructions and addresses and has one statement for each instruction. People use higher-level languages {compiler language} {high-level language}, with one statement for several instructions, such as BASIC, FORTRAN, COBOL, UNIX, and DOS.
early procedural computer language {ALGOL language}.
Simple basic-function languages {BASIC language} can be for interactive use.
early procedural computer language {COBOL language}.
Computer languages {Java language} can be object oriented. Java has classes with methods. A main static method may be first. Methods use "get" and "put" for getting and setting values, "is" or "has" for boolean test functions, and action verbs for methods that change state or take action in other ways. Methods should proceed from public to protected to private. Within each group, methods should start with constructors, then instance methods, then static methods. Java has local and global class member instance variables and static member variables. Java has constants. Create output using System.out.println. The entire system has to be layered and buildable in a single pass. A script defines the order in which the packages are built. Java 2 Enterprise Edition (J2EE) defines application servers for Enterprise Java Beans (EJB), Servlets, and Java Server Pages (JSP), to make web-enabled applications.
Interactive computer languages {LISP language} can be for symbol manipulation. Symbols can be numbers, words {atom, LISP}, or groups {list, LISP}. Data and operations are both lists {list structure}. Programs use, modify, and recognize lists. List addresses contain two pointers, one to current list value and other to next list item. LISP can perform all string operations and compare lists and operations. Lists can have any number of dimensions.
Relational database queries use a language {SQL language} {Structured Query Language}. Make variable names no more than 31 characters. Declare cursors explicitly. Primary cursors remain open. Secondary cursors close after fetching all rows.
table
In a database, each data structure is a table, with columns and rows. The rows are records, a set of information about one item, and the columns are each attributes of the item.
datatype
Each column has entries all in one datatype. The datatypes are integer, floating point number, fixed length field of n characters, variable length field of characters, bit, binary fixed length field of n characters, money, and date and time. A "null" entry means an unknown entry, not blank or zero.
queries
select column, column, ... from table - retrieves data from columns in the table and displays in the order specified.
select column from table where phrase - phrase sets conditions for selection. The phrase may use symbols such as =, >, <, >=, <=, !=, !>, and !< and may use connectors such as and, or, not, between m and n, is null, is not null, in ( ... ), not in ( ... ), and LIKE ' '. The symbols that can be used in LIKE are % for any string of 0 or more characters, _ for anyone character, [ ] for any single character in a range or set, [^] for any single character not in a range or set.
function
select function from table - runs a function, such as "getdate ()".
order
select column from table order by column - sorts in ascending order.
select column from table order by column desc - sorts in descending order.
group
select column from table group by column, column, ... - makes nested groups.
select column from table group by column having phrase - phrase sets conditions for grouping.
operator
select operator(column) - operators check numbers of entries: count(column), max(column), min(column), sum(column), avg(column).
insert
insert table (column, column, ... ) (column-1-name datatype, ...) values ('x', 'y') - inserts rows into table at the columns specified using the values in order.
update
update table set column, column, ... from table where phrase - modifies one table by updating its rows.
delete
delete table from table where phrase - deletes rows from table.
Exception
EXCEPTION traps errors. Some named exceptions are ZERO_DIVIDE, NO_DATA_FOUND, TOO_MANY_ROWS, VALUE_ERROR, OTHERS (for all errors). For example, EXCEPTION WHEN ZERO_DIVIDE THEN RESULT1 = NULL;. It has no continue.
Use all function arguments. Be able to access all code {code access}.
Add comments {code comments} for logical units. Add comments for modifications. Add inline comment after final brace to identify original brace.
Use IF-THEN-ELSE {conditional statement, software}, rather than multiple IFs. Use compound IFs, rather than nested IFs. Use braces for nested IF blocks. Always use ELSE after ELSE IF. Enter NULL statement ";" in IF block with no action. Use Switch statements, rather than IF-THEN-ELSE, if possible. Use default Switch at end, containing at least break statement.
Use symbolic constants {constant, software}, with no hard-coded numbers.
Do not use mixed data types {data type} in expressions. Do not use machine-dependent data representations.
Use dynamic memory {dynamic memory, computer}, rather than allocating fixed storage. Verify that memory gave information. Free all memory structures no longer used. Allocate memory to structures to keep before structures to free, to avoid memory leaks.
Use parameters for error messages {error message} and error numbers, not many hard-coded messages.
Put file name, author, creation date, description, purpose, and modification history in file header {file header, information}.
Put function name, author, creation date, short description, usage, possible return codes, and modification history in function header {function header}.
Return success or failure status {function return} {return, function} to caller. Check status in caller. Store function-return codes in caller for future reference. Do not test function logical value directly. Declare return "void" for functions that do not return value. Declare argument list "void" for functions that do not use parameters.
Do not use GOTO statements {GOTO command}.
Put definitions, global-variable declarations, and function prototypes in header files {header file}. Use "include" statements. For static functions used by one module, put prototype at module top.
Check input values {input, software} for range and reasonableness.
Do not reinitialize index variables in loops {looping, software}. Do not use non-loop-dependent statements in loop bodies.
Put modules in separate files {module files}. Put source code for C++ classes in .CXX files. Put class definitions in .HXX files. Use only logically related functions. Use one entry and exit point for each function. Exit program only through "main" command.
Make object names {object names, software} descriptive and globally unique. Use suffix for object types, like libraries. For functions, use lowercase or mixed case. For variables, use lowercase or mixed case. For constants, use uppercase.
Minimize operating-system services {operating system services}. Put operating-system services in "system" library, not in high-level code.
Separate variables and operators {readability, software}. Write one statement per line, using consistent indentation for logical structure. Place lead brace on same line as statement, or place on next line in same column as statement beginning. Put end brace in same column as statement beginning. Indicate conditional statement using inline comment after end brace.
Use only standard programming language {standard usage, software}.
Use one line for each variable declaration {variable declaration}. Minimize number of global variables and external variables by passing arguments by value or reference. Declare arrays and do not use pointers except for dynamically allocated memory. Use structures for related data elements, to treat them as single objects.
Do not exit from WHILE-statement body {WHILE command}.
Only methods can access objects {encapsulation, programming}.
You can make a child class with all the members and methods of a parent class, and then add extra members and methods {inheritance, programming}.
If classes share common methods, the same methods can apply to all the classes {polymorphism, programming}.
You can use a child-class instance if you can use a parent-class instance {Liskov Substitution Principle}.
Programs can be procedure-oriented, non-procedural, problem-oriented, application-oriented, special purpose, problem defining, problem describing, or problem solving {programming types}.
Programming {functional programming} can change input to output by performing logical relations on input. Sequence and location are not important, because input calls functions, not registers.
Programming {procedural programming} can perform actions on register states to get new register states. Actions must be in exact sequence at one location. Modules are command sets that perform one process or procedure {process box}, such as moving values, performing logical AND, executing if-then-else statement, or iterating through do-while or perform-until statement. Modules can be scripts. BASIC depends on procedures or scripts and is useful for small systems and rapid development.
Software can start with objects and find arrangements that satisfy rule {satisfiability solver} (SAT), in reasonable time.
Programming {structured programming} can use independent modules. Programming languages can use objects {object-oriented programming} {component architecture}, rather than procedures. SVL and Perl have both objects and procedures. C++ and Java are almost all object-oriented, can code larger systems, and can require more development time. Rather than procedures, structured programming languages, such as Java, use independent modules {class} about data types (abstract objects) more complex than basic data types such as integers, floating-point numbers, strings, dates, and arrays. Class groups {Java package} are about one system part, such as file control, database, output, input, or flow control. Software systems are package groups.
Objects model data structures such as windows, files, tables, databases, database query results, and images. Data structures have parameters and constant and/or variable properties.
Classes have procedures {methods} about data structures:
Make {constructor} a specific instance of an abstract object with specific property values.
Make an instance {instance method} of an object with a procedure and a returned value.
Open and close windows.
Open file, write to file, read from file, and close file.
Get table-cell value and set table-cell value.
Change object state or property.
Indicate if statement about object state or property is true or false.
Methods can have parameters and return result values. A main static method starts the program and has a procedure that calls objects.
Methods, classes, and packages can call methods, classes, and packages. Classes and packages can share global constants and variables and can modify global variables.
variables
Programs can use global variables in different ways, or different functions can modify global variables {coupling, Java}. Constants can be global.
unique
Functions, methods, classes, and packages have only one copy, called by other functions, methods, classes, or packages.
comments
Packages, classes, functions, and variables can have comments.
format
Commands at same level indent, typically four spaces, to same position. Line lengths are less than 80 characters. Open braces are at line ends, with their close braces on one separate line lined up with opening-line first character {Microsoft style}.
naming
Object names typically have capitalized syllables or words, as in ElecModelWrapper. High-level objects are nouns, as in ElecModelWrapper. Action names start with verbs, as in writeThisFile. Queries start with "get", as in getString. Information collection starts with "put", as in putString. True or false indicators, with boolean datatype, start with "is", as in isConnected. Names about same thing start the same, as in SysProps and SysVars. Typical prefixes are c for constants, g for globals, m for member variables, s for statics, v for variables, and p for parameters. Names are longer than two characters and use letters rather than numbers.
Outline of Knowledge Database Home Page
Description of Outline of Knowledge Database
Date Modified: 2022.0225